// 判断角色请求 url 的前缀
export const useRolePrefix = function(role) {
  role = parseInt(role)
  let rolePrefix = role === 0 ? 'admin' : role === 1 ? 'teacher' : 'student'
  return rolePrefix
}

// 判断角色 + 处理角色名称首字母大写
export const useRoleTitleCase = function(role) {
  let name = useRolePrefix(role)
  return name.charAt(0).toUpperCase() + name.slice(1)
}